<!DOCTYPE html>
<!--
This is a starter template page. Use this page to start your new project from
scratch. This page gets rid of all links and provides the needed markup only.
-->
<html>
  <head>
    <meta charset="UTF-8">
    <title>机房环境监控</title>
    <meta content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no' name='viewport'>
    <!-- Bootstrap 3.3.2 -->
    <link href="bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
    <link href="bootstrap/css/scojs.css" rel="stylesheet" type="text/css" />
    <link href="bootstrap/css/sco.message.css" rel="stylesheet" type="text/css" />
    <!-- Font Awesome Icons -->
    <link href="font-awesome-4.3.0/css/font-awesome.min.css" rel="stylesheet" type="text/css" />
    <!-- Ionicons -->
    <link href="https://code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css" rel="stylesheet" type="text/css" />
    <link href="plugins/morris/morris.css" rel="stylesheet" type="text/css" />
    <!-- Theme style -->
    <link href="dist/css/AdminLTE.min.css" rel="stylesheet" type="text/css" />
    
    <link href="dist/css/skins/skin-blue.min.css" rel="stylesheet" type="text/css" />
	
    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
        <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
        <script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
    <![endif]-->
  </head>
 
  <body class="skin-blue sidebar-mini">
    <div class="wrapper">

      <!-- Main Header -->
      <header class="main-header">

        <!-- Logo -->
        <a href="" class="logo">
          <!-- mini logo for sidebar mini 50x50 pixels -->
          <span class="logo-mini"><b>IO</b>TU</span>
          <!-- logo for regular state and mobile devices -->
          <span class="logo-lg"><b>IOTU</b>Monitor</span>
        </a>

        <!-- Header Navbar -->
        <nav class="navbar navbar-static-top" role="navigation">
          <!-- Sidebar toggle button-->
          <a href="#" class="sidebar-toggle" data-toggle="offcanvas" role="button">
            <span class="sr-only"><b>IOTU</b>Monitor</span>
          </a>
          <!-- Navbar Right Menu -->
          <div class="navbar-custom-menu">
            <ul class="nav navbar-nav">
              <!-- Messages: style can be found in dropdown.less-->

             
            </ul>
          </div>
        </nav>
      </header>
      <!-- Left side column. contains the logo and sidebar -->
      <aside class="main-sidebar">

        <!-- sidebar: style can be found in sidebar.less -->
        <section class="sidebar">

          <!-- Sidebar Menu -->
          <ul class="sidebar-menu">
            <li class="header">选项</li>
            <!-- Optionally, you can add icons to the links -->
            <li><a href="/monitor"><i class='fa fa-link'></i> <span>信息</span></a></li>
            <li class="active"><a href="manager"><i class='fa fa-link'></i> <span>管理</span></a></li>
          </ul><!-- /.sidebar-menu -->
        </section>
        <!-- /.sidebar -->
      </aside>

      <!-- Content Wrapper. Contains page content -->
      <div class="content-wrapper">
        <!-- Content Header (Page header) -->
        <section class="content-header">
          <h1>
            管理配置
            <small>support by CUIT_IOTU</small>
          </h1>
          <ol class="breadcrumb">
            <li><a href="#"><i class="fa fa-dashboard"></i> 环境监控</a></li>
            <li class="active">管理</li>
          </ol>
        </section>

        <!-- Main content -->
          <section class="content">
          <div class="row">
          <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
            <div class="callout callout-info">
              <h4>Tip!</h4>
              <p>以下配置的输入都没有做严格的限制，请务必按照提示正确的输入。若因输入有误导致系统崩溃，请进入项目代码的根目录手动修改config.properties,然后重启系统</p>
              <p>参数页带*的项在重启项目后生效</p>
            </div>
          </div>
          <h2 class="page-header">系统配置</h2>
          <div class="row">
            <div class="col-md-12">
              <!-- Custom Tabs -->
              <div class="nav-tabs-custom">
                <ul class="nav nav-tabs">
                  <li class="active"><a href="#tab_1" data-toggle="tab">参数</a></li>
                  <li><a href="#tab_2" data-toggle="tab">管理员</a></li>
          
                </ul>
                <div class="tab-content">
                  <div class="tab-pane active" id="tab_1">
                    <div class="row">
                      <div class="col-xs-0 col-sm-0 col-md-2 col-lg-2">
                      </div>
                      <div class="col-xs-12 col-sm-6 col-md-4 col-lg-4">
                        <label for="normaltem" data-trigger="tooltip" data-content="超过此值的温度将会报警" >温度报警值(&#176;C)*</label>
                        <input type="number" name="normaltem" id="normaltem" class="form-control" value="${normaltem}" min="0" max="100" step="" required="required" title="">
                        <label for="interval" data-trigger="tooltip" data-content="监控线程苏醒的数据间隔，即多长检查数据有无异常，不得低于1min">检查时间间隔(min)*</label>
                        <input type="number" name="interval" id="interval" class="form-control" value="${interval}" min="0" max="100" step="" required="required" title="">
                         <label for="secondSpace" data-trigger="tooltip" data-content="二段报警间隔时间，默认1小时。单位hour">二段报警间隔(h)*</label>
                        <input type="number" name="secondSpace" id="secondSpace" class="form-control" value="${secondSpace}" min="1" max="24" step="" required="required" title="">
                      </div>
                      <div class="col-xs-12 col-sm-6 col-md-4 col-lg-4">
                        <label for="normalhum" data-content="低于此值将会报警">湿度报警值*</label>
                        <input type="number" name="normalhum" id="normalhum" class="form-control" value="${normalhum}" min="0" max="100" step="" required="required" title="">
                        <label for="input-id" data-trigger="tooltip" data-content="报警短信发送的手机号以英文逗号分隔。为保证报警信息的送达，请输入至少两个手机号">报警的手机号</label>
                        <input type="text" name="phone" id="phone" class="form-control" value="${phone}" required="required" title="">
                      </div>
                    </div><!--./row-->
                    <p></p>
                    <div class="row">
                      <div class="col-xs-5 col-sm-5 col-md-5 col-lg-5">
                      </div>
                      <div class="col-xs-2 col-sm-2 col-md-2 col-lg-2">
                         <button type="button" class="btn btn-success" id="save1">保存修改</button>
                      </div>
                    </div><!--./row-->
                  </div><!-- /.tab-pane -->
                  <div class="tab-pane" id="tab_2">
                    <div class="row">
                      <div class="col-xs-0 col-sm-0 col-md-2 col-lg-2">
                      </div>
                      <div class="col-xs-12 col-sm-6 col-md-4 col-lg-4">
                        <label for="inputAppkey" data-trigger="tooltip" data-content="聚合数据（http://www.juhe.cn）提供的短信api功能">短信API的appkey</label>
                        <input type="text" name="appkey" id="inputAppkey" class="form-control" value="${appkey}" required="required" disabled="disabled" title="">
                      </div>
                      <div class="col-xs-12 col-sm-6 col-md-4 col-lg-4">
                        <label for="inputPass" data-trigger="tooltip" data-content="忘记密码时点击重置密码时可以将密码重置为cuitiotu">管理员密码</label>
                        <input type="password" name="password" id="inputPass" class="form-control" required="required" >
                      </div>
                    </div><!--./row-->
                    <p></p>
                    <div class="row">
                      <div class="col-xs-5 col-sm-5 col-md-5 col-lg-5">
                      </div>
                      <div class="col-xs-2 col-sm-2 col-md-2 col-lg-2">
                         <button type="button" class="btn btn-success" id="save2">保存修改</button>
                      </div>
                    </div><!--./row-->
                  </div><!-- /.tab-pane -->
                </div><!-- /.tab-content -->
              </div><!-- nav-tabs-custom -->
            </div><!-- /.col -->
          </div> <!-- /.row -->
          </div><!--/.row-->
        
          </section><!-- /.content -->
        </div><!-- /div (log box)-->
        </div><!-- /.row (main row) -->

       
        </section><!-- /.content -->
      </div><!-- /.content-wrapper -->

      <!-- Main Footer -->
      <footer class="main-footer">
        <!-- To the right -->
        <div class="pull-right hidden-xs">
          mail: hanchen@126.com
        </div>
        <!-- Default to the left -->
        <strong>由成都信息工程大学IOTU技术小组提供技术支持</strong> 
      </footer>
      

      <!-- Add the sidebar's background. This div must be placed
           immediately after the control sidebar -->
      <div class='control-sidebar-bg'></div>
    </div><!-- ./wrapper -->

    <!-- REQUIRED JS SCRIPTS -->

    <!-- jQuery 2.1.3 -->
    <script src="plugins/jQuery/jQuery-2.1.3.min.js"></script>
    <!-- Bootstrap 3.3.2 JS -->
    <script src="bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
    <script src="bootstrap/js/sco.tooltip.js" type="text/javascript"></script>
    <script src="bootstrap/js/sco.message.js" type="text/javascript"></script>
    <!-- AdminLTE App -->
    <script src="dist/js/app.min.js" type="text/javascript"></script>
	 <!-- Morris.js charts -->
    <script src="http://cdnjs.cloudflare.com/ajax/libs/raphael/2.1.0/raphael-min.js"></script>
    <script src="plugins/morris/morris.min.js" type="text/javascript"></script>
    <!-- FastClick -->
    <script src='plugins/fastclick/fastclick.min.js'></script>
    <script type="text/javascript">
    	$(function(){
        $("#save1").click(function(){
          $.getJSON("save1",{
            normaltem:$("#normaltem").val(),
            normalhum:$("#normalhum").val(),
            phone:$("#phone").val(),
            interval:$("#interval").val(),
            secondSpace:$("#secondSpace").val()
          },function(data){
              $.each(data,function(k,v){
                if (v == 'success') {
                  $.scojs_message('保存成功', $.scojs_message.TYPE_OK);
                }else{
                  $.scojs_message('保存失败', $.scojs_message.TYPE_ERROR);
                }
              });
          });
        });

        $("#save2").click(function(){
          $.getJSON("save2",{
            appkey:$("#inputAppkey").val(),
            pass:$("#inputPass").val()
          },function(data){
              $.each(data,function(k,v){
                if (v == 'success') {
                  $.scojs_message('保存成功', $.scojs_message.TYPE_OK);
                }else{
                  $.scojs_message('保存失败', $.scojs_message.TYPE_ERROR);
                }
              });
          });
        });
      });
    </script>
   
  </body>
</html>